For all questions in this quiz, consider that you have the following @FetchRequest code, which will fetch desserts from the Dessert entity:
@FetchRequest(
sortDescriptors: AAA,
predicate: BBB,
animation: .default)
private var dishes: FetchedResults
In this example, imagine that the Dessert entity contains two properties, names , and prices , which store dessert names and prices respectively.
How would you fill AAA in the @FetchRequest code above so that the results meet the following criteria?
Sorted by name in alphabetical order
Foreign characters are sorted as regular ones
Case insensitive
How would you fill BBB in the @FetchRequest code above, so you only get results whose name contains the term "Apple Pie"?
How would you fill AAA and BBB in the @FetchRequest code above so that the results meet the following criteria?
Sorted by name and size in alphabetical order
Contain one of terms “carrot cake” or “hamburger”
Price is less than 100
Foreign characters are sorted as regular ones
Case insensitive for both sorting and filtering